
#include <stdio.h>

int
main (int argc, char **argv)
{
  FILE *fp1 = fopen (argv[1], "r");
  FILE *fp2 = fopen (argv[2], "r");

  while (1)
  {
    ch1 = fgetc (fp1);
    ch2 = fgetc (fp2);
    if ((ch1 == EOF) || (ch2 == EOF))
    {
      break;
    }
  }
}

strip_comments ()
{
  int ic = 0x00;
  int icpr = 0x00;
  int state = 0;
  /* state values:
     0 = Outside comment
     1 = After 1st '/' of possible starting comment delimiter
     2 = Inside comment
     3 = After 1st '*' of possible ending comment delimiter
   */

  while (icpr = ic, (ic = getchar ()) != EOF)
  {
    switch (state)
    {
    case 0:
      if (ic == '/')
      {
        state = 1;
      }
      else
      {
        putchar (ic);
      }
      break;
    case 1:
      if (ic == '*')
      {
        state = 2;
      }
      else
      {
        putchar (icpr);         /* The deceptive '/'  */
        putchar (ic);           /* The non-'*'        */
        state = 0;
      }
      break;
    case 2:
      if (ic == '*')
      {
        state = 3;
      }
      else
      {;
      }
      break;
    case 3:
      if (ic == '/')
      {
        state = 0;
      }
      else
      {
        state = 2;
      }
      break;
    }                           /*switch */
  }                             /*while */

  if (state == 1)
  {
    putchar (icpr);             /* Print deceptive '/' (=last char in file) */
  }

  return 0;
}
